import type { VxeGridProps } from '#/adapter/vxe-table'
import dayjs from 'dayjs'
// 列表表头
export const columns: VxeGridProps['columns'] = [
    { align: 'center', title: '', type: 'checkbox' },
    { title: '序号', type: 'seq' },
    { field: 'id', title: '分组名称' },
    { field: 'agentType', title: '代理类型' },
    { field: 'region', title: '地区' },
    { field: 'ip', title: 'IP地址/服务器网址' },
    { field: 'username', title: '账号' },
    { field: 'password', title: '密码' },
    { field: 'password', title: '是否被使用' },
    { field: 'port', title: '端口号' },
    { field: 'startTime', title: '到期日期',slots: { default: 'startTime' } },
    { field: 'networkGroupId', title: '关联账号',slots: { default: 'networkGroupId' } },
    {
        field: 'action',
        fixed: 'right',
        slots: { default: 'action' },
        title: '操作',
        width: 120
    }
]

// 表单配置保持不变
export const formSchema = [
    {
        fieldName: 'id',
        label: '分组名称',
        component: 'Input'
    },
    {
        fieldName: 'region',
        label: '地区',
        component: 'Input'
    },
    {
        fieldName: 'ip',
        label: 'IP地址/网址',
        component: 'Input'
    },
    {
        fieldName: 'expireDate',
        label: '到期日期',
        component: 'RangePicker',
        componentProps: {
            showTime: {
                disabledTime: false,
                defaultValue: [dayjs('00:00:00', 'HH:mm:ss'), dayjs('23:59:59', 'HH:mm:ss')]
            },
            format: 'YYYY-MM-DD HH:mm:ss',
            valueFormat: 'YYYY-MM-DD HH:mm:ss'
        }
    },
    {
        fieldName: 'agentType',
        label: '代理类型',
        component: 'Select',
        componentProps: {
            options: [
                { label: '全部', value: 'null' },
                { label: '动态', value: true },
                { label: '静态', value: false }
            ]
        }
    }
]
